/*
 * =====================================================================================
 *
 *       Filename:  main.cpp
 *
 *    Description:  the main program of exercise 4
 *
 *        Version:  1.0
 *        Created:  11/07/11 20:38:57
 *       Revision:  none
 *       Compiler:  g++
 *
 *         Author:  LittleQ Su (), 98703060@nccu.edu.tw
 *        Company:  National Chengchi University, The Department of Computer Science
 *
 * =====================================================================================
 */
#include "Matrix.h"
#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;


int main() {
    int col, row, temp;
    vector<Matrix> A;
 
    for ( int mtime = 0 ; mtime < 2 ; ++ mtime ) {
        cout << "Matrix " << mtime + 1 << ":" << endl;
        scanf("%d %d" , &col , &row);

        Matrix tempM(row, col);
        A.push_back(tempM);

        for ( int y = 0 ; y < row ; ++y ){
            for (int x = 0 ; x < col ; ++ x ) {
                scanf("%d" , &temp);
                A[mtime].set(y, x, temp);
            }
        }
    }

    (A[0] + A[1]).print();
    (A[0] - A[1]).print();
    (A[0] * A[1]).print();



    

    return 0;
}
